<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>title</title>
<link rel="stylesheet" href="../assets/agile/css/ratchet/css/ratchet.min.css">
<link rel="stylesheet" href="../assets/agile/css/flat/flat.component.css">
<link rel="stylesheet" href="../assets/agile/css/flat/flat.color.css">
<link rel="stylesheet" href="../assets/agile/css/flat/iconline.css">
<link rel="stylesheet" href="../assets/app/css/app.css" />
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery.js"></script>
<script type="text/javascript" src="../script/local.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
</head>
<body>
<section style="margin-bottom:0px !important;margin-top:150px !important;">
<div class="menu_icon" style="box-shadow:none;border-bottom:1px solid #ccc;">
<ul>
<li><a href="javascript:qiandao();"><img src="../res/new_1.png" />每日签到</a></li>
<li><a href="javascript:glist();"><img src="../res/new_2.png" />新品直购</a></li>
<li><a href="javascript:gtbase();"><img src="../res/new_3.png" />组团众筹</a></li>
<li><a href="javascript:randomSwitchBtn('freego',api);"><img src="../res/new_4.png" />免费抢购</a></li>
<li><a href="javascript:randomSwitchBtn('noticelist',api);"><img src="../res/new_5.png" />活动公告</a></li>
<li><a href="javascript:randomSwitchBtn('teamlottery',api);"><img src="../res/new_6.png" />组团揭晓</a></li>
<li><a href="javascript:randomSwitchBtn('shaidan',api);"><img src="../res/new_7.png" />晒单分享</a></li>
<li><a href="javascript:;" id="wxfun"><img src="../res/new_8.png" />邀请有奖</a></li>
<li><a href="javascript:agent();"><img src="../res/new_9.png" />新合伙人</a></li>
<li><a href="javascript:randomSwitchBtn('userrecharge',api);"><img src="../res/new_10.png" />我要充值</a></li>
<!--
        <li><a href="javascript:qiandao();"><img src="../res/icon_4.png" />每日签到</a></li>
        <li><a href="javascript:glist();"><img src="../res/icon_2.png" />0元购</a></li>
        <li><a href="javascript:gtbase();"><img src="../res/icon_7.png" />组团包购</a></li>
        <li><a href="javascript:agent();"><img src="../res/icon_3.png" />新合伙人</a></li>
        <li><a href="javascript:randomSwitchBtn('shaidan',api);"><img src="../res/icon_5.png" />晒单分享</a></li>
        <li><a href="javascript:;" id="wxfun"><img src="../res/icon_6.png" />推广有奖</a></li>
        <li><a href="javascript:jfgoods();"><img src="../res/icon_8.png" />优品直购</a></li>
        <li><a href="javascript:randomSwitchBtn('userrecharge',api);"><img src="../res/icon_1.png" />充值返现</a></li>
-->
    </ul>
</div>

<div class="container jx_goods autoLot" style="box-shadow:none;">    
    <div class="news_jx">
        <span class="jx-span">即将揭晓</span>
        <button class="btn btn-link btn-nav pull-right" style="display:none;">
            <a href="###"><span class="icon icon-right-nav"></span></a>
        </button>
    </div>
<div id="autoLottery">
		<div id="afterlist"></div>
		<div id="deletNode">
		<div class="autotime" item="12" tag="end" data-endtime="120">
			<div class="autotime_left">
			<p><a href="javascript:;">加载中...</a></p>
			<div class="lot">
			<span class="count_time"></span>
			<div class="LotteryTime"><b class="minute">00</b>:<b class="second">00</b>:<b class="millisecond">00</b></div>
			<!-- 
			<p style="font-size:12px;" class="pz">恭喜<a href="?/mobile/mobile/userindex/<?php echo $value['q_uid'];?>" style="color:#3F5FD5;font-size:12px;"><?php echo get_user_name($value['q_uid']);?></a>获得</p>
			 -->
			</div>
			</div>
			<div class="autotime_right">
			<a href="javascript:;">
				<img alt="" class="lazy" data-original="" />
			</a>
			</div>
		</div>
		<div class="autotime" item="12" tag="end" data-endtime="120">
			<div class="autotime_left">
			<p><a href="javascript:;">加载中...</a></p>
			<div class="lot">
			
			<span class="count_time"></span>
			<div class="LotteryTime"><b class="minute">00</b>:<b class="second">00</b>:<b class="millisecond">00</b></div>
			<!-- 
			<p style="font-size:12px;" class="pz">恭喜<a href="?/mobile/mobile/userindex/<?php echo $value['q_uid'];?>" style="color:#3F5FD5;font-size:12px;"><?php echo get_user_name($value['q_uid']);?></a>获得</p>
			 -->
			</div>
			</div>
			<div class="autotime_right">
			<a href="javascript:;">
				<img alt="" class="lazy" data-original="" />
			</a>
			</div>
		</div>
		<div class="autotime" item="12" tag="end" data-endtime="120">
			<div class="autotime_left">
			<p><a href="javascript:;">加载中...</a></p>
			<div class="lot">
			
			<span class="count_time"></span>
			<div class="LotteryTime"><b class="minute">00</b>:<b class="second">00</b>:<b class="millisecond">00</b></div>
			<!-- 
			<p style="font-size:12px;" class="pz">恭喜<a href="?/mobile/mobile/userindex/<?php echo $value['q_uid'];?>" style="color:#3F5FD5;font-size:12px;"><?php echo get_user_name($value['q_uid']);?></a>获得</p>
			 -->
			</div>
			</div>
			<div class="autotime_right">
			<a href="javascript:;">
				<img alt="" class="lazy" data-original="" />
			</a>
			</div>
		</div>
		<div class="autotime" item="12" tag="end" data-endtime="120">
			<div class="autotime_left">
			<p><a href="javascript:;">加载中...</a></p>
			<div class="lot">
			
			<span class="count_time"></span>
			<div class="LotteryTime"><b class="minute">00</b>:<b class="second">00</b>:<b class="millisecond">00</b></div>
			<!-- 
			<p style="font-size:12px;" class="pz">恭喜<a href="?/mobile/mobile/userindex/<?php echo $value['q_uid'];?>" style="color:#3F5FD5;font-size:12px;"><?php echo get_user_name($value['q_uid']);?></a>获得</p>
			 -->
			</div>
			</div>
			<div class="autotime_right">
			<a href="javascript:;">
				<img alt="" class="lazy" data-original="" />
			</a>
			</div>
		</div>
		</div>
	</div>
</div>

<div class="container jx_goods" style="box-shadow:none;">    
    <div class="news_jx renqi_recommend">
        <span class="jx-span">人气推荐</span>
        <button class="btn btn-link btn-nav pull-right pullgoods">
            <a href="###">更多<span class="icon icon-right-nav"></span></a>
        </button>
    </div>
    <div id="temp_data">
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
    <figure><div class="goods_img"><a href="javascript:;"><img class="lazy" data-original="" alt="" style="display: block;"></a></div><figcaption><p><a href="javascript:;">加载中...</a></p><div class="info"><div class="left"><progress max="100" value="0" class="css3"><div class="progress-bar"></div></progress><span class="bf_color">抢购进度<em class="bf">加载中...</em></span><div class="clear"></div><button class="common-btn mygroup"><a href="javascript:;">立即抢购</a></button><button class="common-btn oneget" flag="true"><a href="javascript:;">加入清单</a></button></div></div></figcaption></figure>
	</div>
</div>
<div id="copyright" style="padding-top:0px;">
<p style="text-align:center;">客服电话：声明：所有商品活动与苹果公司（apple inc.）无关</p>
</div>	
</section>
</body>
<script type="text/javascript">
window.isHide = {
    adver : 0,
    renqi : 0,
    okshow : 0
};

function gtbase(){
	api.openWin({name:'gtbase','url':'./gtbase.html',reload:true,bounces: false});
}

function agent(){
	var userinfo = getUserinfo();
	if(userinfo['isAgent']=='yes'){
		api.openWin({name:'fansmanage','url':'./fansmanage.html',reload:true});
	}else{
		api.openWin({name:'applyfor','url':'./applyfor.html',reload:true});
	}
}

function glist(){
	localData.set('keyf','0f');
	api.openWin({name:'freewin','url':'./freewin.html',reload:true});
}
function jfgoods(){
	localData.set('keyf','jfgoods');
	api.openWin({name:'freewin','url':'./jfgoods.html',reload:true});
}
//最新揭晓
function freeList(){
	api.openWin({name:'freego','url':'./freego.html',reload:true});
}

//最新揭晓
function indexLast(){
	api.setFrameGroupIndex({
	    name: 'group1',
	    index: 2,
	    scroll: true,
	    reload: true
	});
}


function openFastCart(goods_id,price,num){
	addCart(goods_id,price,num,'index');
	api.setFrameGroupIndex({
	    name: 'group1',
	    index: 3,
	    scroll: true,
	    reload: true
	});
}

//打开商品详情
function openGoods(goods_id){
	/*
	if(!goods_id) api.alert({'msg':'参数错误'});
	localData.set('goods_id',goods_id);
	api.openWin({
		name:'item',
		url:'./item.html',
		reload:true
	});
	*/
}

//打开已揭晓商品页面
function openDataserver(goods_id){
	if(!goods_id) api.alert({'msg':'参数错误'});
	localData.set('dataserver_goods_id',goods_id);
	api.openWin({
		name:'dataserver',
		url:'./dataserver.html',
		reload:true
	});
}
//访问用户首页
function openUserindex(userid){
	if(!userid) api.alert({'msg':'参数错误'});
	localData.set('userid',userid);
	api.openWin({
		name:'userindex',
		url:'./userindex.html',
		reload:true
	});
}


lyzimg();
function qiandao(){
    var userinfo = localData.get('userinfo');
    var userinfo = JSON.parse(userinfo);
    if(userinfo != undefined && userinfo != '' && (typeof userinfo) == 'object'){
		GetJPData(config.url+'/app.php?act=signdo&uid='+userinfo['uid'],{submit:'submit'},function(data){
			if(data['status'] == 0){
		    	api.confirm({
		    	    title: '提示',
		    	    msg: '签到请登录会员喔',
		    	    buttons: ['确定', '取消']
		    	},function( ret, err ){
		    	    if(  ret['buttonIndex']==1 ){
		    	    	randomSwitchBtn('login',api);
		    	    }else{
		    	        //
		    	    }
		    	});
			}else{
				//randomSwitchBtn('qiandao',api);
				api.alert({msg:data['msg']},function(btnIndex,err){
					randomSwitchBtn('qiandao',api);
				});
			}
		});
    }else{
    	api.confirm({
    	    title: '提示',
    	    msg: '签到请登录会员喔',
    	    buttons: ['确定', '取消']
    	},function( ret, err ){
    	    if( ret['buttonIndex']==1 ){
    	    	randomSwitchBtn('login',api);
    	    }else{
    	        //
    	    }
    	});
    }
};

var urlObj = {url:null};

function openItem2(page,id){
	localData.set('goods_id',id);
	api.openWin({
		name:page,
		url:'./'+page+'.html',
		reload:true
	});
}
apiready = function(){
        var header = $api.byId('header');
        //适配iOS 7+，Android 4.4+状态栏
        /*
		api.showProgress({
		     title : '加载中...',
		     text : ''
		 });
        */
        
        $(function(){
			
			$('.pullgoods').click(function(){
				var jsfun = 'changePage(1,true,true);';
				api.execScript({
				    name: 'root',
				    script: jsfun
				});
			});
			
        	$('body').on('click','.goods_img',function(){
        		var goods_id = $(this).attr('item');
        		if(!goods_id) api.alert({'msg':'参数错误'});
        		localData.set('goods_id',goods_id);
        		api.openWin({
        			name:'item',
        			url:'./item.html',
        			reload:true
        		});
        	});
        	
        	function ui(arr){
        		var UIScrollPicture = api.require('UIScrollPicture');
        		UIScrollPicture.open({
        		    rect: {
        		        x: 0,
        		        y: 0,
        		        w: api.winWidth,
        		        h: 150
        		    },
        		    data: {
        		        paths: arr,
        		    },
        		    styles: {
        		        caption: {
        		            height: 35,
        		            color: '#E0FFFF',
        		            size: 13,
        		            bgColor: '#696969',
        		            position: 'bottom'
        		        },
        		        indicator: {
        		            align: 'center',
        		            color: '#FFFFFF',
        		            activeColor: '#DA70D6'
        		        }
        		    },
        		    placeholderImg: 'widget://res/pic.jpg',
        		    contentMode: 'scaleToFill',
        		    interval: 3,
        		    loop: true,
        		    fixedOn: api.frameName,
        		    fixed: false
        		},function( ret, err ){
        		    if(ret){
        		    	if(ret['eventType'] == 'click'){
        			    	var url = urlObj.url[ret['index']];
        					if(api.systemType == 'ios'){
        						api.openApp({
        						    iosUrl: url
        						});
        					}else if(api.systemType == 'android'){
        						api.openApp({
        						    androidPkg: 'android.intent.action.VIEW',
        						    mimeType: 'text/html',
        						    uri: url
        						},function( ret, err ){
        						    if( ret ){
        						         //alert( JSON.stringify( ret ) );
        						    }else{
        						         //alert( JSON.stringify( err ) );
        						    }
        						});
        					}
        		    	}
        		    }else{
        		    	//alert( JSON.stringify( err ) );
        		    }
        		});
        	}
        	
        	//统一获取开始
        	GetJPData(config.url+'/app.php?act=index',{},function(data){
        		
        		if(data['t'] == 1){
        		  var arr = new Array();
        		  var urlArr = new Array();
        	      for(var i in data['slides']['listItems']){
        	    	  arr[i] = data['slides']['listItems'][i]['src'];
        	    	  urlArr[i] = data['slides']['listItems'][i]['url'];
        	      }
        	     urlObj.url = urlArr;
        	     ui(arr);
        		//$('#copyright').html(data['web_copyright']);
        		
        		if(data['renqi']['status'] == 1){
        			var renqi = data['renqi']['data'];
        	    	  var html = '';
        	          for(var j=0;j<renqi.length;j++){
        	              var s="";
        	            if (j % 2 != 0){
        	                s = 'style="border-right:none;"';
        	            }
        	            
        	            html += '<figure '+s+'><div class="goods_img" item="'+renqi[j]['id']+'">';
        	            html += '<a href="javascript:openGoods('+renqi[j]['id']+');">';
        	            html += '<img class="lazy" data-original="'+config.upload_url+'/'+renqi[j]['thumb']+'"  alt=""></a></div>';
        	            html += '<figcaption><p><a href="javascript:openGoods('+renqi[j]['id']+');">'+renqi[j]['title']+'</a></p>';
        	            html += '<div class="info"><div class="left">';
        			    var baifebi = (renqi[j]['canyurenshu']/renqi[j]['zongrenshu'])*100;
        			    html += '<progress max="100" value="'+baifebi+'" class="css3">';
        			    html += '<div class="progress-bar"></div></progress>';
        			    html += '<span class="bf_color">抢购进度<em class="bf">'+parseInt(baifebi)+'%</em></span>';
        			    html += '<div class="clear"></div>';
        			    html += '<button class="common-btn mygroup"><a href="javascript:openFastCart('+renqi[j]['id']+','+renqi[j]['yunjiage']+',1);">立即抢购</a></button>';
        			    html += '<button class="common-btn oneget" goods_id="'+renqi[j]['id']+'"><a href="javascript:addCart('+renqi[j]['id']+','+renqi[j]['yunjiage']+',1);">加入清单</a></button>';
        			    html += '</div></div></figcaption></figure>';
        	     	}
        	         window.isHide.renqi = 1;
        	         $('#temp_data').html(html);
        	         window.isHide.okshow = 1;
        	         //lyzimg();
        		}
        		
        		if(data['homeget']['status'] == 1){
        			var homeget = data['homeget']['data'];
                    var html2 = '';
                    for(var i=0; i<homeget.length;i++){
                        var style="";
                        if(i%2!=0){
                            style = 'style="border-right:none;"';
                        }
                        html2 += '<div class="autotime" item="'+homeget[i]['id']+'" tag="end" data-endtime="-120">';
                		html2 += '<div class="autotime_left">';
                		html2 += '<p><a href="javascript:openDataserver('+homeget[i]['id']+');">'+homeget[i]['title']+'</a></p>';
                		html2 += '<div class="lot">';
        				html2 += '<p style="font-size:12px;" class="pz">恭喜<a href="javascript:openUserindex('+homeget[i]['q_uid']+');" style="color:#3F5FD5;font-size:12px;">'+homeget[i]['username']+'</a>获得</p>';
        				html2 += '</div></div><div class="autotime_right">';
        				html2 += '<a href="javascript:openDataserver('+homeget[i]['id']+');">';
        				html2 += '<img alt="" class="lazy" data-original="'+config.upload_url+'/'+homeget[i]['thumb']+'" />';
        				html2 += '</a></div></div>';  
                    }
                    $('#deletNode').remove();
                  	$('#afterlist').after(html2);
                  	window.isHide.renqi = 1;
        		}
        		setInterval(function(){
        			var i = 0;
        			$('#autoLottery div.autotime').each(function(){
        				if($(this).attr('tag') == 'start'){
        					i++;
        				}
        			});
        			if(i >= 4){
        				return false;
        			}
        			show_get_lottery();
        		},4500);
        		lyzimg();
        		
        		}
        	});
        	//统一获取结束

        	$('body').on('click','#copyright p a',function(){
        		var url = $(this).attr('href');
        		if(api.systemType == 'ios'){
        			api.openApp({
        			    iosUrl: url
        			});
        		}else if(api.systemType == 'android'){
        			api.openApp({
        			    androidPkg: 'android.intent.action.VIEW',
        			    mimeType: 'text/html',
        			    uri: url
        			},function( ret, err ){
        			    if( ret ){
        			         //alert( JSON.stringify( ret ) );
        			    }else{
        			         //alert( JSON.stringify( err ) );
        			    }
        			});
        		}
        		return false;
        	});
        		
        	function show_get_lottery(){
        		var gids = '';
        		$('#autoLottery div.autotime').each(function(){
        			if($(this).attr('tag') == 'start'){
        				gids += $(this).attr('item')+'_';
        			}
        		});
        		
        		$.ajax({
        			url : config.url+'/app.php?act=show_get_lottery&gids='+gids,
        			type : 'GET',
        			dataType : 'jsonp',
        			success : function(data){
        				if(data['status'] == 1){
        					var html = '';
        					html += '<div class="autotime" id="autoTimeLottery'+data['id']+'" item="'+data['id']+'" tag="start" data-endtime="'+data['q_end_time']+'">';
        					html += '<div class="autotime_left">';
        					html += '<p><a href="javascript:openDataserver('+data['id']+');">'+data['title']+'</a></p>';
        					html += '<div class="lot">';
        					html += '<span class="count_time"></span>';
        					html += '<div class="LotteryTime"><b class="minute">00</b>:<b class="second">00</b>:<b class="millisecond">00</b></div>';
        					html += '<p style="font-size:12px;display:none;" class="pz">恭喜<a href="javascript:openUserindex('+data['q_uid']+');" style="color:#3F5FD5;font-size:12px;">'+data['username']+'</a>获得</p>';
        					html += '</div></div><div class="autotime_right">';
        					html += '<a href="javascript:openDataserver('+data['id']+');">';
        					html += '<img alt="'+data['title']+'" src="'+config.upload_url+'/'+data['thumb']+'" />';
        					html += '</a></div></div>';
        					$('#afterlist').after(html);
        					var obj = $('#autoTimeLottery'+data['id']);
        					autoLottery(obj);
        				}
        			}
        		});

        	}
        	
        	$('body').on('click','.openitem',function(){
        		var goods_id = $(this).parents('.autotime').attr('item');
        		openItem('item',goods_id,function(id){
        			localData.set('goods_id',id);
        		});
        	});
        	
        	$('body').on('click','.dataserver',function(){
        		var goods_id = $(this).parents('.autotime').attr('item');
        		openItem('dataserver',goods_id,function(id){
        			localData.set('goods_id',id);
        		});
        	});
        	
        	function autoLottery(obj){
                var _this = $(obj);
                var minute = _this.find('b.minute');
                var second = _this.find('b.second');
                var millisecond = _this.find('b.millisecond');
                var times = (new Date().getTime()) + 1000 * _this.attr('data-endtime'); 
                var goods_id = _this.attr('item');
                var timer = setInterval(function(){
                    var time = times - (new Date().getTime());
                    if(time <= 1){
                      minute.html('00');
                      second.html('00');
                      millisecond.html('00');
                      clearInterval(timer);
                      getGoodsInfo(_this,goods_id);
                      return false;
                    }
                    i =  parseInt((time/1000)/60);
                    s =  parseInt((time/1000)%60);
                    ms =  String(Math.floor(time%1000));
                    ms = parseInt(ms.substr(0,2));
                    if(i<10)i='0'+i;
                    if(s<10)s='0'+s;
                    if(ms<10)ms='0'+ms;
                    minute.html(i);
                    second.html(s);
                    millisecond.html(ms);
                },43);
        	}

        //获取商品揭晓信息
        function getGoodsInfo(_this,goods_id){
        	$(_this).attr('tag','end');
                $.ajax({
                    type : 'GET',
                    url : config.url+'/app.php?act=get_shop_info&goods_id='+goods_id,
                    timeout : 30,
                    dataType : 'jsonp',
                    async : false,
                    beforeSend : function(xhr){
                      $(_this).find('div.LotteryTime').html('正在计算...');
                      setTimeout(function(){
                    	  $(_this).find('div.LotteryTime').remove();
                    	  $(_this).find('div.count_time').remove();
                    	  $(_this).find('div.lot p').show();
                      },3000);
                     },
                    success : function(res){
                        if(res['status'] == 1){
                      	 
                        }
                    }
                });
        }

        //getCopyright();
        function getCopyright(){
            $.ajax({
                type : 'GET',
                url : config.url+"/app.php?act=copyright",
                dataType : 'jsonp',
                success : function(res){
                    $('#copyright').html(res['html']);
                }
            });
        }

        });
        
        
		var setIntID = setInterval(function(){
		    if(window.isHide.renqi == 1 && window.isHide.okshow == 1){
		        api.hideProgress();
		        clearInterval(setIntID);
		    }
		},500);

		if(api.connectionType == 'none'){
			api.showProgress({
			     title : '未连接网络',
			     text : ''
			 });
			return false;
		}else{
			setTimeout(function(){
				api.hideProgress();
			},15000);
		}
		
		var wxfun = document.getElementById('wxfun');
		wxfun.onclick = function(){
			api.openWin({
				name:'fxcenter',
				url:'./fxcenter.html',
				reload:true
			});
		};
		
		setTimeout(function(){
			api.setRefreshHeaderInfo({
			    visible: true,
			    loadingImg: 'widget://image/refresh.png',
			    bgColor: '#fff',
			    textColor: '#333',
			    textDown: '下拉刷新...',
			    textUp: '松开刷新...',
			    showTime: true
			}, function(ret, err ){
				
			setTimeout(function(){
				api.refreshHeaderLoadDone();
			},15000);
				
			    //在这里从服务器加载数据，加载完成后调用api.refreshHeaderLoadDone()方法恢复组件到默认状态
				  var rq = '';
				  $.ajax({
				      type : 'GET',
				      url : config.url+"/app.php?act=renqi",
				      dataType : 'jsonp',
				      success : function(info){
				    	api.refreshHeaderLoadDone();
				      if(info['status'] == 0){
				    	  
				      }else{

				    	  if(info['slides']['state'] == 0){
				    		  var arr = new Array();
				    		  var urlArr = new Array();
				    	      for(var i in info['slides']['listItems']){
				    	    	  arr[i] = info['slides']['listItems'][i]['src'];
				    	    	  urlArr[i] = info['slides']['listItems'][i]['url'];
				    	      }
				    	     urlObj.url = urlArr;
				    	     var UIScrollPicture = api.require('UIScrollPicture');
				    	     UIScrollPicture.reloadData({data: {paths: arr}});
				    	  }
				    	 
				      	var html = '';
				          for(var j=0;j<info['data'].length;j++){
				              var s="";
				            if (j % 2 != 0){
				                s = 'style="border-right:none;"';
				            }
				            
				            html += '<figure '+s+'><div class="goods_img" item="'+info['data'][j]['id']+'">';
				            html += '<a href="javascript:openGoods('+info['data'][j]['id']+');">';
				            html += '<img class="lazy" data-original="'+config.upload_url+'/'+info['data'][j]['thumb']+'"  alt=""></a></div>';
				            html += '<figcaption><p><a href="javascript:openGoods('+info['data'][j]['id']+');">'+info['data'][j]['title']+'</a></p>';
				            html += '<div class="info"><div class="left">';
						    var baifebi = (info['data'][j]['canyurenshu']/info['data'][j]['zongrenshu'])*100;
						    html += '<progress max="100" value="'+baifebi+'" class="css3">';
						    html += '<div class="progress-bar"></div></progress>';
						    html += '<span class="bf_color">抢购进度<em class="bf">'+parseInt(baifebi)+'%</em></span>';
						    html += '<div class="clear"></div>';
						    html += '<button class="common-btn mygroup"><a href="javascript:openFastCart('+info['data'][j]['id']+','+info['data'][j]['yunjiage']+',1);">立即抢购</a></button>';
						    html += '<button class="common-btn oneget" goods_id="'+info['data'][j]['id']+'"><a href="javascript:addCart('+info['data'][j]['id']+','+info['data'][j]['yunjiage']+',1);">加入清单</a></button>';
						    html += '</div></div></figcaption></figure>';
				   		}
				         $('#temp_data').html(html);
				         lyzimg();
				         
				      }
				     }
				  });
			    
			});
		},500);

};
</script>
</html>